Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistently handle none/NaN across library #476

Merged
merged 2 commits into from
Mar 14, 2024

Conversation

facelessuser
Copy link
Collaborator

This fixes bad conversion due to "none" usage and other "none" related issues.
Ref #475

Copy link

netlify bot commented Mar 10, 2024

Deploy Preview for colorjs ready!

Name Link
🔨 Latest commit 03a91b4
🔍 Latest deploy log https://app.netlify.com/sites/colorjs/deploys/65ee52a7dcfdc70008b79b76
😎 Deploy Preview https://deploy-preview-476--colorjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@lloydk lloydk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for the APCA contrast method which doesn't handle colors with none.

> new Color("red").contrast(new Color("rgb(none 100% 100%)"), "apca");
> NaN

@facelessuser
Copy link
Collaborator Author

Yeah, I was fixing existing handling, I didn't try to identify new broken cases 🙂

@facelessuser
Copy link
Collaborator Author

I'll address it.

@facelessuser
Copy link
Collaborator Author

Done

> new Color("red").contrast(new Color("rgb(none 100% 100%)"), "apca");
-53.91362069001541

Copy link
Member

@LeaVerou LeaVerou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic work, thank you so much!!

@facelessuser facelessuser merged commit e3a0a0d into color-js:main Mar 14, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants